package com.cait.title.dao;

import java.util.List;

import com.cait.title.model.Order;

public class OrderDao extends AbstractDao<Order>
{
    private static final OrderDao instance = new OrderDao();

    public enum Property
    {
        firstName, lastName, address1, address2, zip, city, state, country, subdivision, lot, taxId, description

    }

    private OrderDao()
    {
        super(Order.class);
    }

    public static OrderDao getInstance()
    {
        return instance;
    }

    public List<Order> findByTaxId(String taxId) throws Exception
    {
        return findByPropertyNameValue(Property.taxId.name(), taxId);
    }

    public List<Order> findBySubdivision(String subdivision) throws Exception
    {
        return findByPropertyNameValue(Property.subdivision.name(), subdivision);
    }

    public List<Order> findByLastName(String lastName) throws Exception
    {
        return findByPropertyNameValue(Property.lastName.name(), lastName);
    }
}
